$(function () {
    $(".tableBtn").click(function () {
        username = $(".username").val();
        password = $(".password").val();
        params = {
            "username": username,
            "password": password,
        };
        $.ajax({
            url: '/loginpost/',
            type: 'POST',
            data: JSON.stringify(params),
            contentType: 'application/json',
            dataType: 'json',
            async: false,
            success: function (data) {
                location.href = "/"
            },
            error: function () {
                alert('用户名或密码错误！')
            }
        })

    })

});









